package com.sd.sl;

import java.io.FileInputStream;
import java.io.IOException;

public class Test7 {


        public static void main(String[] args) throws IOException {
            FileInputStream fis = new FileInputStream("1.txt");
            byte[] buffer = new byte[1024];
            int bytesRead;
            StringBuilder content = new StringBuilder();
            while ((bytesRead = fis.read(buffer)) != -1) {
                content.append(new String(buffer, 0, bytesRead));
            }
            System.out.println("文件内容：" + content.toString());
        }
    }